<%-- 
    Document   : Sp_CenterContainer_AddBook
    Created on : Apr 6, 2015, 8:52:40 PM
    Author     : PHATNBSE61057
--%>

<%@page import="personal.dao.CategoryDAO"%>
<%@page import="personal.obj.Category"%>
<%@page import="java.util.List"%>
<%@page import="java.util.ArrayList"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<td class="centerContainer">
    <div class="c1">
        <div class="c2">
            <div class="top"></div>
        </div>
    </div>

    <div class="content">
        <div class="content-wrapper">
            <a name="main"></a>
            <span id="serch_error">
            </span>
            <div id="pageTitle" class="pageTitleSection">
                <div class="block">
                    <div class="cont">
                        <h2><span>Adding New Book</span></h2>
                    </div>
                </div>
            </div>

            <div class="accountSection">
                <div class="form">
                    <div class="block">
                        <div class="corner1">
                            <div class="corner2">
                                <div class="lineTop"></div>
                            </div>
                        </div>
                        <div class="cont">
                            <!--                            <span id="register_error">
                                                        </span>-->
                            <c:set var="error" value="${requestScope.ERRORMESSAGE}"/>
                            <span>
                                <c:if test="${not empty error}">
                                    <p class="error">
                                        Required field must not be blank. Price must positive. Pages must a positive integer.
                                    </p>
                                </c:if>
                            </span>
                            <form action="ProcessServlet" method="POST">
                                <div class="loginDetails">
                                    <h4>Main Info</h4>
                                    <div class="firstName">
                                        <label class="requiredParameter">Book Name
                                            <span class="reqIcon"></span>
                                        </label>
                                        <input class="textInput" name="txtBookName" type="text">
                                    </div>
                                    <div class="firstName" style="height: 34px">
                                        <label class="requiredParameter">Category
                                        </label>
                                        <%
                                            List<String> listCateName = new ArrayList<String>();
                                            CategoryDAO cateDAO = new CategoryDAO();
                                            listCateName = cateDAO.getAllCategoryName();
                                        %>
                                        <select name="ddlCategory" style="width: 307px; height: 30px; padding:0 2px;">
                                            <%
                                                for (String cateName : listCateName) {
                                            %>
                                            <option><%=cateName%></option>
                                            <%
                                                }
                                            %>
                                        </select>
                                    </div>
                                </div>

                                <div class="horLine"></div>

                                <div class="contactDetails">
                                    <h4>Book Details</h4>
                                    <div class="phone">
                                        <label class="requiredParameter">Book Price
                                            <span class="reqIcon"></span>
                                        </label>
                                        <input class="textInput" name="txtPrice" type="text">
                                    </div>

                                    <div class="phone">
                                        <label class="requiredParameter">Pages
                                            <span class="reqIcon"></span>
                                        </label>
                                        <input class="textInput" name="txtPages" type="text">
                                    </div>

                                    <div class="phone">
                                        <label class="requiredParameter">Format
                                            <span class="reqIcon"></span>
                                        </label>
                                        <input class="textInput" name="txtFormat" type="text">
                                    </div>

                                    <div class="phone">
                                        <label class="requiredParameter">Author
                                            <span class="reqIcon"></span>
                                        </label>
                                        <input class="textInput" name="txtAuthor" type="text">
                                    </div>

                                    <div class="phone">
                                        <label class="requiredParameter">ISBN
                                            <span class="reqIcon"></span>
                                        </label>
                                        <input class="textInput" name="txtISBN" type="text">
                                    </div>

                                    <div class="phone">
                                        <label class="requiredParameter">Detailed Edition
                                            <span class="reqIcon"></span>
                                        </label>
                                        <input class="textInput" name="txtDetailedEdition" type="text">
                                    </div>

                                    <div class="phone">
                                        <label class="requiredParameter">Description
                                            <span class="reqIcon"></span>
                                        </label>
                                        <textarea name="txtDescription" rows="10" cols="20" 
                                                  style="text-align: left;font-size: 0.8em; padding: 6px !important;color: #444; border: solid 1px #ECECEC;">
                                        </textarea>
                                    </div>
                                </div>

                                <div class="horLine"></div>

                                <input class="middleBtn rightBtn bigBtn" value="Add" type="submit" name="btAction">

                                <div class="nofloat"></div>
                            </form>
                        </div>
                        <div class="corner4">
                            <div class="corner3">
                                <div class="lineBtm"></div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>

    <div class="c4">
        <div class="c3">
            <div class="btm"></div>
        </div>
    </div>
</td>